//*****************************************************************************
//  C++: HW3
//  Shragay Dror (ID:038778445)
//  Zilber Jenia (ID:313975492)
//*****************************************************************************


#include "Analyser.h"

#include <iterator>

using namespace std;

int main()
{

	//*************************************************************************
	// Using test.txt as input file
	//*************************************************************************
	Parser prs("test.txt");
	//*************************************************************************
	// Dividing input file to lines 
	//*************************************************************************
	prs.divideToLines();
	//*************************************************************************
	// Printing out the number of lines
	//*************************************************************************
	cout << "Number of lines: "<< prs.getNumOfLines() << endl;
	//*************************************************************************
	// Dividing lines into tokens
	// suggested ++ -- == -> << >> as one token
	//*************************************************************************
	InputLine inp(prs);
	inp.tokenizeFile();
	//*************************************************************************
	// Printing out the number of tokens in line 2
	//*************************************************************************
	cout << "Number of tokens in line 2: " << inp.getNumOfTokensInLine(2) 
		 << endl;
	//*************************************************************************
	// Printing out the number of tokens in file
	//*************************************************************************
	cout << "Number of tokens in file: " << inp.getNumOfTokensInFile() << endl;
	//*************************************************************************
	// Printing out file tokens
	//*************************************************************************
	inp.printOutFileTokens();
	//*************************************************************************
	// Analysing tokens and printing out possible errors
	//*************************************************************************
	Analyser anls(inp);
	anls.doAnalyse();

	return 0;
}